	{include file="common/header.tpl"}
<body>
<div id="wrapper">
	<script src="../view/admin/js/module_news.js" type="text/javascript"></script>
	{include file="common/toptab.tpl"}
    {if $smarty.get.sub eq "editnews"}
    	{include file="BgcmsNews/edit.tpl"}
    {elseif $smarty.get.sub eq "CreateNews"}
    	{include file="BgcmsNews/create.tpl"}
    {else}
    
    <div class="wrap">
    <div id='ajaxResponse1' class="ajaxResponse" {if $smarty.cookies.message != NULL}style="display:block"{/if}>{if $smarty.cookies.message != NULL}{$smarty.cookies.message}{/if}</div>
		<p>
	    <a href="?{$smarty.server.QUERY_STRING}&sub=CreateNews"> 
			<img src="../view/admin/images/object_create.png" alt="Create" />
        </a>
		</p>
    	<table class="widefat" cellpadding="0" cellspacing="0">
	        <thead>
	        <tr>
	            <th scope="col" align="center">{TranslateTag}B_LABEL_ID{/TranslateTag}</th>
	            <th scope="col" align="left">{TranslateTag}B_LABEL_THUMBNAIL{/TranslateTag}</th>
	            <th scope="col" align="left">News Titel</th>
                <th scope="col" style="text-align:center">Active</th>
	            <th scope="col" colspan="2" style="text-align:center">{TranslateTag}B_LABEL_ACTION{/TranslateTag}</th>
	        </tr>
	        </thead>
	        <tbody id="thelist">
	            {foreach name=news from=$ARR_ALL_NEWS_DATA.data item=item}
	                <tr id="news_{$item->news_id}" class="{cycle values=,alternate}">
	                    <td  align="center">{$item->news_id}</td>
	                    <td  align="left">
                        <img src="../{$item->news_image_small}">	
                        </td>
	                   	<td  align="left">{$item->news_name}</td>
                        <td  align="center">{if $item->active eq 1 }x{else}-{/if}</td>

	                    <td>
							<a href="?module={$smarty.get.module}&amp;sub=editnews&amp;id={$item->news_id}" class="edit"><img src="../view/admin/images/object_edit.png" alt="Edit" /></a>
                        </td>
                        <td>    
							<a onClick="onDeleteNews('?module={$smarty.get.module}','{$item->news_id}', 'ajaxResponse1')" class="delete"><img src="../view/admin/images/object_delete.png" alt="Delete" /></a>
						</td>

	                </tr>
	            {/foreach}
	        </tbody>
	    </table>
        {if $ARR_ALL_NEWS_DATA.TOTALDATA>0}
        <div style="height:20px;margin:20px 0 5px 0;">			
              <div style="width:300px; float:left" align="left"> 
              {$ARR_ALL_NEWS_DATA.TOTAL} of {$ARR_ALL_NEWS_DATA.TOTALDATA}
              </div>			
              <div style="width:300px; text-align:right; float:right" >{$ARR_ALL_NEWS_DATA.FIRST} {$ARR_ALL_NEWS_DATA.PRE}&nbsp;{$ARR_ALL_NEWS_DATA.LISTPAGE} of&nbsp; {$ARR_ALL_NEWS_DATA.TOTALPAGE} &nbsp;                   
                  <select onChange="javascript:window.location='{$ARR_ALL_NEWS_DATA.LINK}&{$ARR_ALL_NEWS_DATA.PATHNAME}='+this.value">
                    {$ARR_ALL_NEWS_DATA.COMBOPAGE}                     
                  </select>&nbsp;{$ARR_ALL_NEWS_DATA.NEXT} {$ARR_ALL_NEWS_DATA.LAST}         
              </div>		
       </div>
       {/if}
	   	<p>
	    <a href="?{$smarty.server.QUERY_STRING}&sub=CreateNews"> 
			<img src="../view/admin/images/object_create.png" alt="Create" />
        </a>
		</p>
	</div>
    {/if}
</div>    
</body>